import Vue from 'vue'

import 'ant-design-vue/dist/antd.css'
import AntUI, { Icon , } from 'ant-design-vue'
import VueLazyload from 'vue-lazyload' // 懒加载
import * as filters from '@/filters' // 导入所有filters
import App from './App.vue'
import router from './router'
import store from './store'
import '@/styles/app.scss'
import './utils/core'
import iconFont from '../static/iconfont/iconfont'
import TitleCard from '@/components/common/TitleCard'
import IconWrap from '@/components/common/IconWrap'
import Spanning from '@/components/common/Spanning'
import MediaWrap from '@/components/common/MediaWrap'
import Viewer from './directive/viewer'
import Loading from './directive/loading'
import Empty from './directive/empty'
import * as echarts from 'echarts'
Vue.prototype.$bus = new Vue()
Vue.prototype.$echarts = echarts
window.$projectName = '培训平台系统ByXiYan'
Vue.use(Viewer)
Vue.use(Loading) // 全局注册 v-loading 指令
Vue.use(Empty) // 全局注册 v-Empty 指令
Vue.config.productionTip = false
const aIcon = Icon.createFromIconfontCN({
  scriptUrl: iconFont
})
Vue.use(AntUI)
Vue.component('my-icon', aIcon)
Vue.component('IconWrap', IconWrap)
Vue.component('TitleCard', TitleCard) // 全局注册
Vue.component('Spanning', Spanning) // 全局注册
Vue.component('MediaWrap', MediaWrap) // 全局注册
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: filters.fillPublicPath('/static/img/zwtp.png'),
  loading: filters.fillPublicPath('/static/img/loading.gif'),
  attempt: 1
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
